﻿using System;
using System.Collections.Generic;
using ProductFeedbackE = JTLeigh.Commerce.Spencer.Features.ProductFeedback.Common.Entities.ProductFeedback;

namespace JTLeigh.Commerce.Spencer.Features.ProductFeedback.Business.Behaviors.ProductFeedbackSelection
{

    /// <summary>
    /// Behavior used to select product feedback without sorting or filtering.
    /// </summary>
    public class DefaultBehavior : IProductFeedbackSelectionBehavior
    {

        #region IProductFeedbackSelectionBehavior Members

        /// <summary>
        /// Selects product feedback.
        /// </summary>
        /// <param name="feedback">The <see cref="Dictionary{TKey,TValue}"/> of 
        /// <see cref="ProductFeedback"/> objects to select from.</param>
        /// <returns>An ordered <see cref="IList{T}"/> of the selected <see cref="ProductFeedbackE"/>
        /// objects.</returns>
        /// <remarks>
        /// <para>
        /// This method returns all keys in <paramref name="feedback"/>.
        /// </para>
        /// </remarks>
        public IList<ProductFeedbackE> SelectProductFeedback(Dictionary<Guid, ProductFeedbackE> feedback)
        {
            List<ProductFeedbackE> result;

            result = new List<ProductFeedbackE>(feedback.Values.Count);
            result.AddRange(feedback.Values);
            return result;
        }

        #endregion // IProductFeedbackSelectionBehavior Members

    }

}
